package com.atguigu.lease.web.app.service.impl;

import com.atguigu.lease.model.entity.LeaseAgreement;
import com.atguigu.lease.model.entity.PaymentType;
import com.atguigu.lease.web.app.mapper.*;
import com.atguigu.lease.web.app.service.LeaseAgreementService;
import com.atguigu.lease.web.app.vo.agreement.AgreementDetailVo;
import com.atguigu.lease.web.app.vo.agreement.AgreementItemVo;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author liubo
 * @description 针对表【lease_agreement(租约信息表)】的数据库操作Service实现
 * @createDate 2023-07-26 11:12:39
 */
@Service
public class LeaseAgreementServiceImpl extends ServiceImpl<LeaseAgreementMapper, LeaseAgreement>
        implements LeaseAgreementService {
@Autowired
private  PaymentTypeMapper paymentTypeMapper;

    private final LeaseAgreementMapper leaseAgreementMapper;

    public LeaseAgreementServiceImpl(LeaseAgreementMapper leaseAgreementMapper) {
        this.leaseAgreementMapper = leaseAgreementMapper;
    }

    @Override
    public List<AgreementItemVo> listAgreementItemByPhone(String username) {
        List<AgreementItemVo> agreementItemVo = leaseAgreementMapper.getAgreementItemVo(username);

        return agreementItemVo;

    }

    @Override
    public AgreementDetailVo getAgreementDetailById(Long id) {
        return leaseAgreementMapper.getAgreementDetailVoById(id);
    }

    @Override
    public List<PaymentType> listByRoomId(Long id) {
        return paymentTypeMapper.selectListByRoomId(id);
    }

}




